<%-- 
    Document   : category
    Created on : Mar 29, 2014, 5:54:15 PM
    Author     : windows 7 Ult
--%>
<%@ page import="java.io.*,java.util.*,java.sql.*"%>
<%@ page import="javax.servlet.http.*,javax.servlet.*" %>
<%@page import="java.sql.ResultSet"%>
<%@page import="java.sql.Statement"%>
<%@page import="java.sql.DriverManager"%>
<%@page import="java.sql.Connection"%>
<%@page contentType="text/html" pageEncoding="UTF-8"%>

<%@ page isELIgnored ="false" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/sql" prefix="sql"%>

<%@ include file="header.jsp" %>
    <sql:query dataSource="${conn}" var="productResult">
        SELECT Product.*,catName from Product,Category where Product.id = ? and categoryId = Category.id ;
        <sql:param value="${param.prodId}"  />
    </sql:query>
    <!-- start top_bg -->
    <script src="js/addtocart.js" type="text/javascript"></script>
    <div class="top_bg">
        <div class="wrap">
            <div class="main_top">
                <h2 class="style">${productResult.rows[0].catName}</h2>
            </div>
        </div>
    </div>
    <!-- start main -->
    <div class="main_bg">
        <div class="wrap">
            <div class="main">
                  <div class="single">
			<div class="left_content">
			<div class="span1_of_1">
				<!-- start product_slider -->
				<div class="product-view">
				    <div class="product-essential">
				        <div class="product-img-box">
				    
                                            <div class="product-image"> 
                                                <a class="cloud-zoom" rel="adjustX:30,adjustY:0,position:'right',tint:'#202020',tintOpacity:0.5,smoothMove:2,showTitle:true,titleOpacity:0.5" data-fancybox-group="thumb" href="DisplayImage?id=${productResult.rows[0].id}" title="Women Shorts" alt="Women Shorts">
                                                    <img src="DisplayImage?id=${productResult.rows[0].id}" alt="Women Shorts" title="Women Shorts" />
                                                </a>
                                            </div>
                                        </div>
                                    </div>
				</div>
			<!-- end product_slider -->
			</div>
                            <!-- start span1_of_1 -->
                            <div class="span1_of_1_des">
                                <div class="desc1">
                                    <h3>${productResult.rows[0].name}</h3>
                                    <h5>Rs. ${productResult.rows[0].price} 
                                        <!-- 
                                        <c:set value="${productResult.rows[0].price + 50}" var="dis" ></c:set>
                                        <span>${dis}</span> 
                                        -->
                                    </h5>
                                    <div class="available">
                                        <div class="btn_form">
                                            <form action="AddToCart" >
                                                <input id="q-${productResult.rows[0].id}" type="number" name="quantity" value="1" />
                                                <input type="hidden" name="productId" value="${productResult.rows[0].id}"/>
                                                <input type="submit" value="Add To Cart" onclick="return addToCart(${productResult.rows[0].id})" />    
                                            </form>                                            
                                        </div>
                                        <p class="desc1">${productResult.rows[0].description}</p>
                                    </div>					
                         
                                </div>
                            </div>
                            <div class="clear"></div>
			   	
                        </div>
                        <!-- start left_sidebar -->
			<div class="left_sidebar">
                            <ul class="det_nav">
                                <sql:query dataSource="${conn}" var="catResult">
                                    SELECT * from Category;
                                </sql:query>
                                <c:forEach var="row" items="${catResult.rows}">
                                    <li><a href="catproduct.jsp?catId=<c:out value="${row.id}"/>"><c:out value="${row.catName}"/></a></li>
                                </c:forEach>					
                            </ul>								
			</div>
                        <div class="clear"></div>                            
                  </div>	
                  <!-- end content --> 
             </div>
        </div>
    </div>
    <%@ include file="footer.jsp" %>
